import { $get, $post } from '@/utils/request'

// 商家查看待审核商品
export const FIND_TO_BE_EVALUATE = (shopId, checkState, pageNo, pageSize) =>
  $get(
    `/store-api/find/to/be/evaluate?shopId=${shopId}&checkState=${checkState}&pageNo=${pageNo}&pageSize=${pageSize}`
  )

// 商家查询置顶评价列表
export const FIND_GOODS_TOP_EVALUATE = (shopId, pageNo, pageSize) =>
  $get(
    `/store-api/find/goods/top/evaluate?shopId=${shopId}&pageNo=${pageNo}&pageSize=${pageSize}`
  )

// 商品评价置顶取消 （有新接口了）
export const CANCCEL_EVALUATE_TOP = params =>
  $post(`/store-api/cancel/goods/evaluate/top`, params)

// 商品评价置顶 （有新接口了）
export const SET_EVALUATE_TOP = params =>
  $post(`/store-api/set/goods/evaluate/top`, params)

// 商家审核回复 to do 这个地方钟平要处理
export const SET_SHOP_EVALUATE = params =>
  $post(`http://211.149.216.90:6001/shop/back/evaluate/goods`, params)

// 商品详情展示星级查询
export const FIND_GOODS_STAR = (shopId, goodsNo) =>
  $get(`/store-api/ev1/find/goods/star/${shopId}/${goodsNo}`)

// 商家审核回复
export const SHOP_SUBMIT_EVALUATE = params =>
  // $post(`http://211.149.216.90:6001/shop/back/evaluate/goods`, params)
  $post(`/store-api/shop/back/evaluate/goods`, params)

// 商铺查看评价奖励配置
export const FIND_SHOP_SET_CONFIG = shopId =>
  $get(`/store-api/find/store/evalauate/config`, { shopId })

// 商铺设置贝币赠送数量
export const SET_SHOP_COMMERT_AWARD_CONFIG = params =>
  $post(`/store-api/set/shop/factor`, params)

// 获取优惠券
export const GET_COU_PON = params =>
  $post(`/store-api/coupon/getCoupon`, params)

// 后台分页查询优惠券列表
export const FIND_COUPON_PAGE = (params, pageNo, pageSize) =>
  $post(`/store-api/couponProvider/findCouponPage`, params, {
    pageNo,
    pageSize
  })
